package com.wr.springbootadmin.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

/**
 * @author 王瑞
 * @description: 整合基于OkHttp3配置RestTemplate
 * @date 2021/1/26  16:43
 */
@Configuration
public class RestTemplateConfig {



    /**
     * 基于OkHttp3配置RestTemplate
     *
     */
    @Bean
    public RestTemplate restTemplate(){
        RestTemplate restTemplate = new RestTemplate(new OkHttp3ClientHttpRequestFactory());
        return restTemplate;
    }
}
